package edu.gatech.mobile.scene.ui.image;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.view.View;

public class LabelView extends View{
    private Paint   mBitmapPaint;
	private Bitmap image;
	private Bitmap mask;
	private Canvas  mCanvas;
	
	public LabelView(Context context, Bitmap image) {
		super(context);
		this.image= image;
		//this.mask = mask;
		mCanvas = new Canvas(this.image);
		mBitmapPaint = new Paint(Paint.DITHER_FLAG);
		//drawMask();
		
	}
	  @Override
	    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
	        super.onSizeChanged(w, h, oldw, oldh);
	    }
	
	    @Override
	    protected void onDraw(Canvas canvas) {
	    	canvas.drawBitmap(image, 0, 0, mBitmapPaint);

	    }
	    
	    
		public void drawOnCanvas(Bitmap bitmap) {
			Paint paint = new Paint();
			paint.setStrokeWidth(1);
			paint.setAlpha(80);
			this.mCanvas.drawBitmap(bitmap, 0, 0, paint);
			this.mCanvas.save();
		}
	    
	    
	    
		public void drawOnCanvas(int color, float x, float y) {
			Paint paint = new Paint();
			paint.setColor(color);
			paint.setStrokeWidth(1);
			paint.setAlpha(80);
			this.mCanvas.drawPoint(x, y, paint);
			this.mCanvas.save();
		}
		
		public void drawOnCanvas(int color, float left, float top, float right, float bottom) {
			Paint paint = new Paint();
			paint.setColor(color);
			paint.setStrokeWidth(1);
			paint.setAlpha(80);
			this.mCanvas.drawRect(left, top, right, bottom, paint);
		}
}
